package com.trkj.dao.jpa;


import java.util.Date;
import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import com.trkj.pojos.Card;

public interface J_CardDao extends JpaRepository<Card, String>{
	/**
	 * 找到最大的卡号
	 * @return
	 */
	@Query(nativeQuery = true,value="select max(substr(CRAD_ID,2)) from card")
	public String findMaxCardId();
	
	/**
	 * 根据身份证号来查找
	 * @return
	 */
	@Query(nativeQuery = true,value="select * from card where ID_CARD=?1 and TIME_ between ?2 and ?3")
	public List<Card> findByIdCard(String idCard,Date start_date,Date end_date);
}
